<?php
defined ('_VALID_MOS') or
    die('Direct Access to this location is not allowed');

if (isset($this->form)) {
    echo $this->form;
}
if ($this->modules !=NULL): 
    $this->DataTables('.adminlist');?>
<div class="ui-widget-content">
    <table class="adminlist" cellspacing="1">
    <thead>
        <tr>
            <th>
                Name
            </th>
            <th width="10%">
                Id
            </th>
            <th width="10%">
                Web Id
            </th>            
            <th>
                Actions
            </th>
        </tr>
    </thead>
    <tbody>
        <?php foreach($this->modules as $module):
            $params = json_decode($module->params);
            $addParams = json_decode($params->addparams);?>
        <tr>
            <td><?php echo $addParams->title;?></td>
            <td><?php echo $addParams->list_id;?></td>
            <td><?php echo $addParams->web_id;?></td>
            <td>
                <a href="index.php?option=com_modules&task=module.edit&id=<?php echo $module->id;?>"
                   title="Edit Joomla Module" class="ui-button ui-state-default ui-corner-all"
                   style="padding: .4em 1em;">
                    Joomla Module
                </a>                
            </td>
        </tr>
        <?php endforeach;?>
    </tbody>
    </table>
</div>
<?php else:?>
<p>No Modules exist for this list.</p>
<?php endif;